import java.util.*;
public class Main {
    public static Set<Character> set = new HashSet<>();
    public static String getString() {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.nextLine();
        scanner.close();
        return s;
    }
    public static void solution() {
        for (char i = 'a'; i <= 'z'; i++) set.add(i);
        for (char i = 'A'; i <= 'Z'; i++) set.add(i);
        for (char i = '0'; i <= '9'; i++) set.add(i);
        set.add('-');
        String srcStr = getString();
        String[] strs = srcStr.split(" ");
        Stack<String> stack = new Stack<>();
        for (String str : strs) {
            for (String s : handle(str)) if (!" ".equals(s)) stack.push(s);
        }
        List<String> arr = new ArrayList<>();
        while (!stack.isEmpty()) arr.add(stack.pop());
        System.out.println(String.join(" ", arr));
    }
    public static List<String> handle(String str) {
        if (" ".equals(str)) return new ArrayList<>();
        String replace = str.replace("--", " ");
        List<String> ans = new ArrayList<>();
        StringBuilder builder = new StringBuilder();
        for (String s : replace.split(" ")) {
            builder.delete(0, builder.length());
            for (int i = 0; i < s.length(); i++) {
                if (set.contains(s.charAt(i))) {
                    if (s.charAt(i) == '-') {
                        if (i == 0 || i == s.length() - 1) continue;
                        builder.append('-');
                    } else {
                        builder.append(s.charAt(i));
                    }
                }
            }
            if ("".equals(builder.toString())) continue;
            ans.add(builder.toString());
        }
        return ans;
    }
    public static void main(String[] args) {
        solution();
    }

}
